<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>search_list</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&display=swap" rel="stylesheet"> 
<script src="https://corteousquestions.club/libraries/w3.js"></script>
<link href="search_list.css" rel="stylesheet">
</head>
<body>
<div class="grid-container">
 <div class="content-wrap">
 <div class="col_center">
<?php
$question = $_GET['quest'];
   
try {
  $where = "localhost";
  $user = "root";
  $password = "xxxx";
  $dbname = "dazed";
  $pdo = new PDO("mysql:host=$where;dbname=$dbname", $user, $password);
  $sql = "SELECT title, link, description FROM dazed WHERE MATCH(title, author, description, tags, categories) AGAINST ('$question' IN NATURAL LANGUAGE MODE)";  
  $q = $pdo->query($sql);
  $q->setFetchMode(PDO::FETCH_ASSOC); 
  } catch(PDOException $e) {
     echo "Error: " . $e->getMessage();
  }
?>
<?php while ($row = $q->fetch()): ?>
<a href="<?php echo ($row['link']); ?>"><?php echo '['; ?><?php echo ($row['title']); ?><?php echo ']'; ?></a>
<h6><?php echo ($row['description']); ?></h6>
<?php endwhile; ?>
</div>
</div>
</div>
<div w3-include-html="https://corteousquestions.club/partials/footer_pages.html">
<script>w3.includeHTML();</script>
</body>
</html>
